﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HandBook.Data
{
    public class EatDrinkData
    {
        private EatDrinkDBDataContext _EatDrinkDB = new EatDrinkDBDataContext();
        public IQueryable GetAllRestaurents()
        {
            var restList = from rest in _EatDrinkDB.Restaurants
                           select rest;
            return restList;
        }
        public void UpdateRestaurant(Restaurant rest)
        {
            var restTemp = _EatDrinkDB.Restaurants.Single(r => r.RestID == rest.RestID);
            restTemp.RestName = rest.RestName;
            _EatDrinkDB.SubmitChanges();         
        }
    }
}
